// 默认组件数据配置
const defaultData = {
  // 文本组件默认数据
  text: {
    data: [
      {
        type: "title",
        title: "这里是文本标题",
        color: "",
        fontSize: 20,
        titleFontSize: 20,
        fontWeight: "bold",
        textAlign: "left",
      },
      {
        type: "paragraph",
        content: "这里是文本内容这里是文本内容这里是文本内容这里是文本内容",
        color: "#333333",
        contentColor: "#986523",
        fontSize: 14,
        fontWeight: "normal",
        textAlign: "left",
      },
    ],
  },
  // 文章列表表格列配置
  articleTable: {
    headers: [
      {
        title: "文章编号",
        prop: "articleId",
        minWidth: "130",
        align: "center",
      },
      {
        title: "文章名称",
        prop: "articleName",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "阅读量",
        prop: "readCount",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "转发量",
        prop: "forwardCount",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "收藏数",
        prop: "collectCount",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "留言数",
        prop: "messageCount",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "发布人",
        prop: "publishUser",
        minWidth: "100",
        align: "center",
      },
      {
        title: "发布时间",
        prop: "publishTime",
        minWidth: "120",
        align: "center",
      },
      {
        title: "状态",
        prop: "status",
        minWidth: "100",
        align: "center",
        scopedSlots: { customRender: "status" },
      },
      {
        title: "操作",
        prop: "operate",
        minWidth: "100",
        align: "center",
        sortable: true,
        scopedSlots: { customRender: "action" },
      },
    ],
  },
  // 轮播图列表表格列配置
  carouselTable: {
    headers: [
      { title: "业务名称", prop: "name", minWidth: "130", align: "center" },
      {
        title: "类型",
        prop: "type",
        minWidth: "100",
        align: "center",
        sortable: true,
      },
      {
        title: "图片",
        prop: "image",
        // width: "160",
        // 将固定宽度改为最小宽度，让列可以自适应
        minWidth: "100",
        align: "center",
        sortable: true,
        scopedSlots: { customRender: "image" }, //当前列自定义渲染
      },
      {
        title: "上传时间",
        prop: "uploadTime",
        width: "160",
        align: "center",
        sortable: true,
      },
      {
        title: "上传人",
        prop: "uploadUser",
        minWidth: "100",
        align: "center",
      },
      {
        title: "状态",
        prop: "status",
        minWidth: "50",
        align: "center",
        scopedSlots: { customRender: "status" }, //当前列自定义渲染
      },
      {
        title: "操作",
        prop: "operate",
        minWidth: "200",
        align: "center",
        sortable: true,
        scopedSlots: { customRender: "action" },
      },
    ],
  },
  // 发布弹窗表格列配置
  dialogTableHeaders: {
    headers: [
      {
        title: "文章编号",
        prop: "articleId",
        minWidth: "130",
        align: "center",
      },
      {
        title: "文章名称",
        prop: "articleName",
        minWidth: "100",
        align: "center",
        sortable: false,
      },
      {
        title: "顺序",
        prop: "readCount",
        minWidth: "100",
        align: "center",
        sortable: false,
      },
      {
        title: "操作",
        prop: "forwardCount",
        minWidth: "100",
        align: "center",
        sortable: false,
      },
    ],
  },
  // 相关按钮配置数组
  actionButtons: {
    topArticleButtons: [
      {
        id: "add",
        text: "新增",
        icon: "el-icon-plus",
        handler: "handleAddClick",
        customStyle: {
          backgroundColor: "#E8F4FF",
          borderRadius: "5px",
          cursor: "pointer",
          color: "#508EF2",
          border: "2px solid #508EF2",
        },
      },
      {
        id: "release",
        text: "发布",
        icon: "el-icon-edit",
        handler: "handleReleaseClick",
        customStyle: {
          backgroundColor: "#FFF0E9",
          borderRadius: "5px",
          cursor: "pointer",
          color: "#FF7225",
          border: "2px solid #FF7225",
        },
      },
      {
        id: "edit",
        text: "修改",
        icon: "el-icon-edit",
        handler: "handleEditClick",
        customStyle: {
          backgroundColor: "#E6F7F1",
          borderRadius: "5px",
          cursor: "pointer",
          color: "#43C393",
          border: "2px solid #43C393",
        },
      },
      {
        id: "delete",
        text: "删除",
        icon: "el-icon-delete",
        handler: "handleDeleteClick",
        customStyle: {
          backgroundColor: "#FEEEEE",
          borderRadius: "5px",
          cursor: "pointer",
          color: "#F88484",
          border: "2px solid #F88484",
        },
      },
    ],
    tableArticleButtons: [
      {
        id: "online",
        text: "上架",
        handler: "handleOnlineClick",
      },
      {
        id: "editRow",
        text: "编辑",
        handler: "handleRowEditClick",
      },
      {
        id: "deleteRow",
        text: "删除",
        handler: "handleRowDeleteClick",
        style: { marginLeft: "10px" },
      },
    ],
    tableCarouselButtons: [
      {
        id: "editRow",
        text: "编辑",
        handler: "handleRowEditClick",
      },
      {
        id: "deleteRow",
        text: "删除",
        handler: "handleRowDeleteClick",
        style: { marginLeft: "10px" },
      },
    ],
  },
};

export const textDefaultData = defaultData.text.data;
export const articleTableHeaders = defaultData.articleTable.headers;
export const carouselTableHeaders = defaultData.carouselTable.headers;
export const dialogTableHeaders = defaultData.dialogTableHeaders.headers;
export const actionButtons = defaultData.actionButtons;